# include <bits/stdc++.h>
using namespace std;
// 求最大公约数
int gcd(int a,int b)
{
    if (a%b==0)
        return b;
    int c = a;
    a = b;
    b = c%b;
    return gcd(a,b);
}
// 求最小公倍数
int lcm(int a,int b)
{
    return a*b/gcd(a,b);
}
int main()
{
    cout << gcd(12,18) << endl;
    cout << lcm(12,18) << endl;
    return 0;
}